<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>文档关键词维护</title>
		<link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
		<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="/static/web/css/admin.css">
	</head>
	<body>
		<form name="form2" action="article_keywords_main.php">
			<input type="hidden" name="dopost" value="add">
			<table class="table shadow-sm my-3">
				<tr>
					<td>
						<input type="text" name="keyword" id="keyword" placeholder="请输入关键词" class="admin-input-lg mr-3">
						<input type="text" name="rpurl" id="rpurl" placeholder="请输入链接" class="admin-input-lg mr-3">
						<input type="text" name="rank" id="rank" value="30" class="admin-input-sm">
						<button type="submit" name="submit" class="btn btn-success btn-sm">搜索</button>
					</td>
				</tr>
			</table>
		</form>
		<form name="form3" action="article_keywords_main.php" method="post">
			<input type="hidden" name="dopost" value="saveall">
			<table class="table shadow-sm my-3">
				<tr>
					<td colspan="5">文档关键词维护</td>
				</tr>
				<tr align="center">
					<td width="6%">选择</td>
					<td width="30%">关键词</td>
					<td width="30%">链接网址</td>
					<td width="10%">频率</td>
					<td>操作</td>
				</tr>
				{dede:datalist empty='<tr><td colspan="5" align="center">暂无记录</td></tr>'}
				<tr align="center">
					<td><input type="checkbox" name="aids[]" value="{dede:field.aid/}" checked></td>
					<td><input type="hidden" name="keyword_{dede:field.aid/}" class="admin-input-lg" value="{dede:field.keyword/}">{dede:field.keyword/}</td>
					<td>
						<input type="hidden" name="rpurlold_{dede:field.aid/}" value="{dede:field.rpurl/}">
						<input type="text" name="rpurl_{dede:field.aid/}" class="admin-input-lg" value="{dede:field.rpurl/}">
					</td>
					<td><input type="text" name="rank_{dede:field.aid/}" class="admin-input-sm" value="{dede:field.rank/}"></td>
					<td>
						<input type="hidden" name="staold_{dede:field.aid/}" value="{dede:field.sta/}">
						<label><input type="checkbox" name="isnouse_{dede:field.aid/}" value="1" {dede:field.sta function="GetSta(@me)"/}> 禁用</label>
						<label><input type="checkbox" name="isdel_{dede:field.aid/}" value="1"> 删除</label>
					</td>
				</tr>
				{/dede:datalist}
				<tr>
					<td colspan="5">
						<button type="button" name="dl1" class="btn btn-success btn-sm" onclick="selAll();">反选</button>
						<button type="button" name="dl2" class="btn btn-success btn-sm" onclick="this.form.submit();">保存</button>
					</td>
				</tr>
				<tr>
					<td colspan="5" align="center">{dede:pagelist listsize='6'/}</td>
				</tr>
			</table>
		</form>
		<script>
			function selAll() {
				var celements = document.getElementsByName('aids[]');
				for (i = 0; i < celements.length; i++) {
					if (!celements[i].checked) celements[i].checked = true;
					else celements[i].checked = false;
				}
			}
		</script>
	</body>
</html>